package com.woniu.humanresource.listener;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.woniu.humanresource.entity.Employees;

import java.util.ArrayList;
import java.util.List;
//文件导入
public class EmpListener extends AnalysisEventListener<Employees> {
    private static List<Employees> employeeList = new ArrayList<>();
    @Override
    public void invoke(Employees employees, AnalysisContext analysisContext) {
        employeeList.add(employees);
//        System.out.println("解析到一条数据：" + employees);
    }

    @Override
    public void doAfterAllAnalysed(AnalysisContext analysisContext) {
//        System.out.println("全部解析完成");
    }
//获取解析数据
    public static List<Employees> getEmployeeList() {
        return employeeList;
    }
}
